package com.wzm.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class Rsp<T>{

    private boolean success;
    private int code;
    private String message;
    private String timestamp;
    // if success, get this.
    private T Rst;
    // if error, get this.
    private List<Error> errors;
    private Result result;

    public Result getResult() {
        return success ? result : null;
    }

    public T getRst() {
        return success ? Rst : null;
    }

    public boolean getSuccess(){
        return this.success;
    }

    public T isSuccess() {
        return null;
    }
}